خرید بک لینک
public static void copyDirectoryOneLocationToAnotherLocation(File sourceLocation, File targetLocation) throws IOException { if (sourceLocation.isDirectory()) { if (!targetLocation.exists()) { targetLocation.mkdir(); } String[] children = sourceLocation.list(); for (int i = 0; i < sourceLocation.listFiles().length; i++)

برچسب: نحوه,کردن,فولدر,تمام,پوشه, نویسنده: پارسا موسوی تاريخ: جمعه 3 شهريور 1396 ساعت: 8:35

ابتدا فایل xml ساخته و دکمه های مورد نیاز رو روش میذاریم بعد در فایل java که با این صفحه مرتبط هست، این تابع رو مینویسم و در جایی دلخواه اونو فراخوانی میکنیم:public void dialog() { AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this); LayoutInflater inflater = this.getLayoutInflater(); final View row = inflater.inflate(R.l

برچسب: استفاده,آلرت,دیالوگ, نویسنده: پارسا موسوی تاريخ: جمعه 3 شهريور 1396 ساعت: 8:35

private void share_file(File file){

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
sendIntent.setType("*******");//نوع فایل رو مشخص میکنیم مثلا برای فایل زیپ "application/zip"
startActivity(sendIntent);

}


برچسبها: ارسال فایل, Intent, کد, اندروید, جاوا

برچسب: ارسال,فایل,ابزار,دستگاه,کاربر, نویسنده: پارسا موسوی تاريخ: جمعه 3 شهريور 1396 ساعت: 8:35

public static boolean deleteDir(File dir) {
if (dir.isDirectory()) {
String[] children = dir.list();
for (int i=0; i
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
retu false;
}
}
}
// The directory is now empty so delete it
retu dir.delete();
}


برچسبها: حذف فولدر, زیرپوشه, اندروید, جاوا, کد

برچسب: فولدر,تمام,فایل, نویسنده: پارسا موسوی تاريخ: جمعه 3 شهريور 1396 ساعت: 8:35

برای فایل صوتی از این اینتنت استفاده میکنیم:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File("***"); //آدرس فایل
intent.setDataAndType(Uri.fromFile(file), "audio/*");
startActivity(intent);

برای فایل عکس از این اینتنت استفاده میکنیم:

Intent intent = new Intent();
intent.setAction(android.content.Intent.ACTION_VIEW);
File file = new File("*******");//آدرس فایل
intent.setDataAndType(Uri.fromFile(file), "image/*");
startActivity(intent);


برچسبها: باز کردن فایل, اینتنت, Intent, جاوا, کد

برچسب: کردن,فایل,ابزار,دستگاه,کاربر, نویسنده: پارسا موسوی تاريخ: جمعه 3 شهريور 1396 ساعت: 8:35

صفحه بندی